package cz.semjob.output.data;

import java.util.HashMap;
import java.util.Map;

import cz.semjob.document.processing.DocumentInstance;

public class CandidateInstance {
	
	private DocumentInstance documentInstance;
	
	private CandidateConcept linkedConcept;
	
	private int startIndex;
	
	private int endIndex;
	
	private String text;
	
	private Map<String, CandidateInstance>  relations;

	public CandidateInstance(DocumentInstance documentInstance, CandidateConcept linkedConcept, int startIndex,
			int endIndex, String text) {
		super();
		this.documentInstance = documentInstance;
		this.linkedConcept = linkedConcept;
		this.startIndex = startIndex;
		this.endIndex = endIndex;
		this.text = text;
		this.relations = new HashMap<String, CandidateInstance>();
	}

	public void addRelation(String relationName, CandidateInstance relatedInstance) {
		this.relations.put(relationName, relatedInstance);
	}

	public CandidateConcept getLinkedConcept() {
		return linkedConcept;
	}

	public int getStartIndex() {
		return startIndex;
	}

	public int getEndIndex() {
		return endIndex;
	}

	public String getText() {
		return text;
	}

	public Map<String, CandidateInstance> getRelations() {
		return relations;
	}

	public DocumentInstance getDocumentInstance() {
		return documentInstance;
	}

	public void setDocumentInstance(DocumentInstance documentInstance) {
		this.documentInstance = documentInstance;
	}
	
	
	


}
